from django.template import Library

register = Library()

@register.simple_tag
def active(request, pattern):
    import re

    if re.search(pattern, request.path):
        return 'active'

    return 'not-active'
